var http="http://mealview.zyy.sn.cn/"
var whhttp="http://meal.zyy.sn.cn/"
// 弹窗
function newalert(msg,time=2000){
  $("div[id^=newalert]").remove();
  let thistime =Date.now();
  $("body").append(`<div id="newalert`+thistime+`" style="width: 100%;height: 48px;line-height: 48px;text-align: center;z-index: 999999999;position: fixed;top: 0;left: 0;bottom: 0;right: 0;font-size: 14px;margin: auto;color: #fff;">
    <span style="color: #fff;
    line-height: 60px;
    background: rgba(0, 0, 0, 1);
    display: inline-block;
    padding: 0 25px;
    border-radius: 8px;
    font-size: 24px;">`+msg+`</span>
  </div>`)
  setTimeout(function(){$("#newalert"+thistime).remove();},time);
}
// 判断token过期
function panduantoken(mycode){
  if(mycode==302){
    newalert("登录过期",1000)
    window.localStorage.removeItem('mytoken')
    window.location.href=http+"/admin/login.html"
    return;
  }
}
function panduantokens(mycode){
  if(mycode==302){
    newalert("登录过期",1000)
    window.localStorage.removeItem('mytoken')
    window.location.href=http+"/login.html"
    return;
  }
}